Copying graphical objects is a common operation in building and using software applications. Traditional copy operations on graphical objects have resulted in creation of new objects that are clones of the original object. Each new object has the same class type and the same properties as the original object.
One class of programs in which graphical object is copied is graphical modeling environments. Examples of graphical modeling environments include time-based block diagrams, such as Simulink from The MathWorks Inc., state-based and flow diagrams, such as those found within Stateflow® also available from The MathWorks, Inc., data-flow diagrams, such as LabVIEW, available from National Instruments Corporation, and software diagrams and other graphical programming environments, such as Unified Modeling Language (UML) diagrams.
Time-based block diagrams are software applications that enable a user to model, simulate, and analyze dynamic systems i.e., systems whose outputs change over time. Time-based block diagrams can be used to explore the behavior of a wide range of real-world dynamic systems, including electrical circuits, shock absorbers, braking systems, and many other electrical, mechanical, and thermodynamic systems.
Simulating a dynamic system in a time-based block diagram is typically a two-step process. First, a user creates a graphical model, such as a block diagram, of the system to be simulated. A graphical model may be created using a graphical user interface, such as a graphical model editor. The graphical model depicts time-based relationships between the systems inputs, states, parameters and outputs. After creation of the graphical model, the behavior of the dynamic system over a specified time period is simulated using the information entered into the graphical model. In this step, the graphical model is used to compute and trace the temporal evolution of the dynamic systems' outputs (“execute the graphical model”), and automatically produce either deployable software systems or descriptions of hardware systems that mimic the behavior of either the entire model or portions of the model (code generation).
Block diagrams are graphical entities having an “executable meaning” that are created within time-based block diagrams for modeling a dynamic system, and generally comprise one or more graphical objects. For example, a block diagram model of a dynamic system is represented schematically as a first collection of graphical objects, such as nodes, which are interconnected by another set of graphical objects, generally illustrated as lines, which represent logical connections between the first collection of graphical objects. In most block diagramming paradigms, the nodes are referred to as blocks and drawn using some form of geometric object (e.g., circle, rectangle, etc.). The line segments are often referred to as signals. Signals correspond to the time-varying quantities represented by each line connection and are assumed to have values at each time instant . Each node may represent an elemental dynamic system, and the relationships between signals and state variables are defined by sets of equations represented by the nodes. Inherent in the definition is the notion of parameters, which are the coefficients of the equations. These equations define a relationship between the input signals, output signals, state, and time, so that each line represents the input and/or output of an associated elemental dynamic system. A line emanating at one node and terminating at another signifies that the output of the first node is an input to the second node. Each distinct input or output on a node is referred to as a port. The source node of a signal writes to the signal at a given time instant when its system equations are solved. The destination node of this signal read from the signal when their system equations are being solved. Those skilled in the art will recognize that the term “nodes” does not refer exclusively to elemental dynamic systems but may also include other modeling elements that aid in readability and modularity of block diagrams.
For example, in Simulink®, an example of a time-based block diagram environment from The MathWorks Inc., a model of a dynamic system is a block diagram comprising a number of graphical objects. Generally, a block diagram comprises a plurality of nodes, called blocks, which are interconnected by lines that represent signals. In Simulink®, each block represents a functional entity, such as an elementary dynamic system, which implements a mathematical operation, i.e., an algorithm or equation, on the data being processed by the system represented by the block diagram. Each block produces an output either continuously (a continuous block) or at specific points in time (a discrete block). The type of the block determines the relationship between a block's outputs and its inputs, states, and time. A block diagram can contain any number of instances of any type of block needed to model a system. The signals in a block diagram model represent a time-varying quantity that is updated, i.e. ready-by and written-to, by the blocks. Simulink® and other software products for modeling a dynamic system provide a graphical user interface (GUI) for building models of dynamic systems as block diagrams. Each block diagram may be built by dragging and dropping blocks provided in pre-defined blocksets or custom developed by the user.
Other examples of block diagrams include state chart diagrams such as those found within Stateflow, also available from The MathWorks, Inc, data flow diagrams, and so on. Many graphical modeling systems employing block diagrams are hierarchical. A hierarchical diagram consists of ‘layers’ where a layer is a diagram in itself and is represent in the ‘parent’ layer as a single block. Connections to the block are routed into the lower layer.
During construction of a block diagram model, a user often copies blocks into the window displaying the model from a library, such as a block library, another model, or the model under construction. To copy a block from a library or other model into the model under construction, a user first opens the appropriate block library or model window. Then, the user drags the block to copy into the target model window. According to one method, a user drags a block by positioning a cursor over the block icon, then pressing and hold down the mouse button to select the block icon. The user moves the cursor into the target window, and releases the mouse button to position the block. Blocks may also be dragged from a library browser into a model window.
Blocks may also be copied using “Copy” and “Paste” commands from an Edit menu. For example, a user may select a block to copy, choose “Copy” from the Edit menu, activate the target model window and select “Paste” from the Edit menu to copy a block.
In the current state of the art, when a user copies a block, the new block automatically inherits all the original block's graphical representation and parameter values. The user must then manually edit the copied block to modify the properties of the copied block, which can be time-consuming.